<div style="clear:both;height:5px;"></div>
<?php 
if(isset($_SESSION['config_template']))
{
	if($_SESSION['config_template']=='layoutmain_web1')
	{
		?>
		<link rel="stylesheet" type="text/css" href="/css/web1/mostviewnews.css" />
		<div class="top_box"><span></span></div>
		<div class="box base-mini">
			<div class="head">
				<h4 style="width:80%;float:left"><?php echo $title;?></h4>
				<!-- Tạo cây bút chì cho click and change -->
				<div style="float: right;">
				<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
				<ul class="gallery clearfix">
					<a href="/mostviewqa/clickchange?iframe=true&width=350&height=300" rel="prettyPhoto[iframe]">
						<img src="/images/web1/Pencil.png" style="width:20px ; height:20px;"></img>
					</a>
				</ul>
				<?php }?>
				</div>
				<!-- End - Tạo cây bút chì cho click and change -->
			</div>
			<div class="middle_box" >
			<ol id="cart-sidebar">
					<li class="odd">
				<?php foreach ($AllMostViewNews as $MostViewNews){?>
			                <div class="most_view_item" align="center" >
			                    <a href="/qa/detail?id=<?php echo $MostViewNews['thing_id'];?>"><div style="height:45px;width:55px;float:left" class="image" align="center" ><img width="55px" height="45px" onerror="this.src='/images/web1/noimage.jpg'" src="<?php if($MostViewNews['avatar'] != null){echo $MostViewNews['avatar'];}else{echo "/images/web1/img_thumb.gif";}?>"/></div></a>
			                    <div class="new" >
			                    	<a style="font-size: 14px;" href="/qa/detail?id=<?php echo $MostViewNews['thing_id'];?>">
			                    		<?php 
		                    	$kt=strlen($MostViewNews['title']);
										if ($kt<=25)  
											echo $MostViewNews['title']; 
										else 
											echo substr($MostViewNews['title'], 0,25)."..";
											?>
			                    	</a>
									<br/>
									<div style="color:rgb(150,150,150); float:right;text-decoration:none;font-size: 11px;"><?php echo $text_view; echo $MostViewNews['views']?></div>                                                                       
			                    </div>
			                </div> 
			     <?php }?>
			 	 </li>
			 	 </ol>
			 </div>
		<div class="bottom_box"><span></span></div>
		</div>
		<?php 
	}
	else 
	{
		if($_SESSION['config_template']=='layoutmain_web2')
		{?>
		<link rel="stylesheet" type="text/css" href="/css/web2/sidebar2.css" media="all">
		    <!-- most view question -->
			<div class="top_box"><span> </span></div>
			<div class="box base-mini mini-most-view-question">
				<div class="head">
					<h4><?php echo $title;?>
					<!-- Tạo cây bút chì cho click and change -->
					<div style="float: right;">
					<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
					<ul class="gallery clearfix">
						<a href="/mostviewqa/clickchange?iframe=true&width=350&height=300" rel="prettyPhoto[iframe]">
							<img src="/images/web1/Pencil.png" style="width:20px ; height:20px;"></img>
						</a>
					</ul>
					<?php }?>
					</div>
					</h4>
					<!-- End - Tạo cây bút chì cho click and change -->					
				</div>
		        <div class="content">
					<?php foreach ($AllMostViewNews as $MostViewNews){?>		        
		        	<div class="most-view-question-item">
						<div class="image-question">
							<a href="/qa/detail?id=<?php echo $MostViewNews['thing_id'];?>" title=""><img onerror="this.src='/images/web2/noimage.jpg'" src="<?php if($MostViewNews['avatar'] != null){echo $MostViewNews['avatar'];}else{echo "/images/web2/img_thumb.gif";}?>" alt="" title=""></a>
						</div>
						<div class="title-question">
		                    <a href="/qa/detail?id=<?php echo $MostViewNews['thing_id'];?>"><h6>			                    		
		                    <?php 
		                    	$kt=strlen($MostViewNews['title']);
										if ($kt<=25)  
											echo $MostViewNews['title']; 
										else 
											echo substr($MostViewNews['title'], 0,25)."..";
											?></h6></a><span>(<?php echo $MostViewNews['views'];?>)</span>
						</div>
		            </div>
		            <?php }?>
		        </div>
			</div>
			<div class="bottom_box"><span> </span></div>
		    <!-- End most view question -->		
		<?php }
		else 
		{?>
	<link rel="stylesheet" type="text/css" href="/css/mostviewqa.css" />
	
	<div style="margin-top:5px;"></div>
	<div id="most_viewed_news">
			<div class="c_navigator">
				<p class="navi_content"><?php echo $title;?></p>
				<!-- Tạo cây bút chì cho click and change -->
				<div style="float: right; margin-right:5px">
				<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
				<ul class="gallery clearfix">
					<a href="/mostviewqa/clickchange?iframe=true&width=350&height=300" rel="prettyPhoto[iframe]">
						<img src="/images/web1/Pencil.png" style="width:20px ; height:20px; margin-top:10px;"></img>
					</a>
				</ul>
				<?php }?>
				</div>
				<!-- End - Tạo cây bút chì cho click and change -->
			</div> <!--end c_navigator-->
			<div style="margin-top:-5px;margin-right:5px;float:right;margin-bottom:5px;">
					<!--<div class="box_small_top" ></div>-->
			        <div class="box_small_content " style="height:auto !important;z-index : 101;position:relative;">
			        	<div style="margin-top: 0;">
			            <?php foreach ($AllMostViewNews as $MostViewNews){?>
			                <div class="most_view_item">
								<div class="image">
			                    <a href="/qa/detail?id=<?php echo $MostViewNews['thing_id'];?>"><div class="image" align="center"><img width="55px" height="45px" src="<?php if($MostViewNews['avatar'] != null){echo $MostViewNews['avatar'];}else{echo "/images/web1/img_thumb.gif";}?>" onerror="this.src='/images/web1/noimage.jpg'"/></div></a>
			                    </div>
								<div class="new">
			                    <a href="/qa/detail?id=<?php echo $MostViewNews['thing_id'];?>" style="vertical-align:middle" lang="50px">
			                    <?php 
		                    	$kt=strlen($MostViewNews['title']);
										if ($kt<=35)  
											echo $MostViewNews['title']; 
										else 
											echo substr($MostViewNews['title'], 0,35)."..";
											?>
											 (<?php echo $MostViewNews['views']?>)  
								</a>                                                 
			                    </div>
			                </div>
			            <?php }?>       
			        	</div>
			        </div>
			        <!--<div class="box_small_bottom" style="margin-top:-30px;;z-index : 100;position:relative;"></div>-->
			 </div>
	 </div>
	 
<?php }
	}
}?>
<div style="clear:both;"></div>
